import http from "@/utils/http";
import {EnumAlias} from "@/utils/common";
// 新增优惠券
export function createDiscount(data?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/coupon/create`,
    method: "post",
    data
  });
}
// 查询优惠券 /{__shortName}/mall/coupon/page
export function queryDiscount(params?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/coupon/page`,
    method: "get",
    params
  });
}
//修改优惠券状态 /{__shortName}/mall/coupon/changeStatus
export function changeStatus(data?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/coupon/changeStatus`,
    method: "post",
    data
  });
}
// 优惠券详情 /{__shortName}/mall/coupon/detail
export function discountDetail(params?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/coupon/detail`,
    method: "get",
    params
  });
}
// 更新优惠券信息 /{__shortName}/mall/coupon/update
export function updateDiscount(data?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/coupon/update`,
    method: "post",
    data
  });
}
// 删除优惠券 /{__shortName}/mall/coupon/delete
export function deleteDiscount(data?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/coupon/delete`,
    method: "post",
    data
  });
}
